<template>
  <div class="learn">
    <p>新的组件 {{title.name}}
      <button @click="sendMsg">传递数据</button>
    </p>
    <p>
      <input type="text" v-model="searchText" >
    </p>
  </div>  
</template>

<script>
export default {
  name:'learn',
  data(){
    return{
      searchText:''
    }
  },
  props:['title'],
  methods:{
    sendMsg(){
      this.$emit("getMsg",this.searchText)
    }
  }
}
</script>

<style>

</style>
